package com.dong.agent.exception;

import java.io.Serializable;

import lombok.Getter;

/**
 * @description 响应包装类
 * @author DongPing
 * @date 2025/05/05 17:53
 **/
@Getter
public class BaseResponse<T> implements Serializable {
    private final int code;

    private final T data;

    private final String message;

    public BaseResponse(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public BaseResponse(int code, T data) {
        this(code, data, "");
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), null, errorCode.getMessage());
    }
}


